home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- /*
- * callbacks.c - callback routines for videofx program
- *
- * some of this code was
- * generated by the ICS builderXcessory (BX).
- * Builder Xcessory 3.0 FT.
- *
- */
-
- #include "callbacks.h"
- #include "creation.h"
-
- /* globals */
- int SwitchType;
- int repeatfactor = 60;
- int speedfactor = 50;
- int fuzzfactor = 100;
-
- /* #define DEBUG 1 */
-
- void getAllChromaVLValues(vals)
- /* returns slider values for widgets obtained using vlGetControls */
- int *vals;
- {
- VLControlValue vlgotval;
- int range, val, min, max;
-
- vlGetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_RANGE_CHROMA_U, &vlgotval);
- range = vlgotval.intVal;
- vlGetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_VALUE_CHROMA_U, &vlgotval);
- val = vlgotval.intVal;
- rangevaltominmax(range, val, &min, &max);
- vals[0] = min;
- vals[1] = max;
- vlGetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_RANGE_CHROMA_V, &vlgotval);
- range = vlgotval.intVal;
- vlGetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_VALUE_CHROMA_V, &vlgotval);
- val = vlgotval.intVal;
- rangevaltominmax(range, val, &min, &max);
- vals[2] = min;
- vals[3] = max;
- vlGetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_DETAIL, &vlgotval);
- vals[4] = vlgotval.intVal;
- }
- void getAllLumaVLValues(vals) /* returns slider values for widgets */
- int *vals;
- {
- VLControlValue vlgotval;
- int range, val, min, max;
-
- vlGetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_RANGE_LUMA, &vlgotval);
- range = vlgotval.intVal;
- vlGetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_VALUE_LUMA, &vlgotval);
- val = vlgotval.intVal;
- rangevaltominmax(range, val, &min, &max);
- vals[0] = min;
- vals[1] = max;
- vlGetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_DETAIL, &vlgotval);
- vals[2] = vlgotval.intVal;
- vlGetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_FG_OPACITY, &vlgotval);
- vals[3] = vlgotval.intVal;
- }
-
- void setAllLumaVLValues(vals) /* returns slider values for widgets */
- int *vals;
- {
- VLControlValue vlctlval;
- int range, val, min, max;
-
- minmaxtorangeval(vals[0],vals[1],&range,&val);
- vlctlval.intVal = range;
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_RANGE_LUMA, &vlctlval);
- vlctlval.intVal = val;
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_VALUE_LUMA, &vlctlval);
- vlctlval.intVal = vals[2];
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_DETAIL, &vlctlval);
- vlctlval.intVal = vals[3];
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_FG_OPACITY, &vlctlval);
- }
-
- /* slider behavior functions */
- void getAllChromaScaleValues(vals)
- int *vals;
- {
- XmScaleGetValue(UminScale,&vals[0]);
- XmScaleGetValue(UmaxScale,&vals[1]);
- XmScaleGetValue(VminScale,&vals[2]);
- XmScaleGetValue(VmaxScale,&vals[3]);
- XmScaleGetValue(ChromasharpScale,&vals[4]);
- #ifdef DEBUG
- printf("getAll chromas: %d %d %d %d %d\n", vals[0],
- vals[1], vals[2], vals[3], vals[4]);
- #endif
- }
- void getAllLumaScaleValues(vals)
- int *vals;
- {
- XmScaleGetValue(YminScale,&vals[0]);
- XmScaleGetValue(YmaxScale,&vals[1]);
- XmScaleGetValue(LumasharpScale,&vals[2]);
- XmScaleGetValue(LumafgopScale,&vals[3]);
- }
-
- void setAllChromaScaleValues(vals)
- int *vals;
- {
- char thestring[5];
-
- #ifdef DEBUG
- printf("inside setAllChromaScaleValues\n");
- printf("setAll chromas: %d %d %d %d %d\n", vals[0],
- vals[1], vals[2], vals[3], vals[4]);
- #endif
-
- XmScaleSetValue(UminScale,vals[0]);
- itoa(vals[0], thestring);
- XmTextFieldSetString(UminTF,thestring);
-
- XmScaleSetValue(UmaxScale,vals[1]);
- itoa(vals[1], thestring);
- XmTextFieldSetString(UmaxTF,thestring);
-
- XmScaleSetValue(VminScale,vals[2]);
- itoa(vals[2], thestring);
- XmTextFieldSetString(VminTF,thestring);
-
- XmScaleSetValue(VmaxScale,vals[3]);
- itoa(vals[3], thestring);
- XmTextFieldSetString(VmaxTF,thestring);
-
- XmScaleSetValue(ChromasharpScale,vals[4]);
- itoa(vals[4], thestring);
- XmTextFieldSetString(ChromasharpTF,thestring);
-
- /* if this routine is used other than w/presets */
- /* careful w/the following TB code: */
-
- /* set lock TB modes to off */
- XmToggleButtonSetState(UrangelockTB, False, True);
- XmToggleButtonSetState(VrangelockTB, False, True);
- }
-
- void setAllLumaScaleValues(vals)
- int *vals;
- {
- char thestring[5];
-
- XmScaleSetValue(YminScale,vals[0]);
- itoa(vals[0], thestring);
- XmTextFieldSetString(YminTF,thestring);
-
- XmScaleSetValue(YmaxScale,vals[1]);
- itoa(vals[1], thestring);
- XmTextFieldSetString(YmaxTF,thestring);
-
- XmScaleSetValue(LumasharpScale,vals[2]);
- itoa(vals[2], thestring);
- XmTextFieldSetString(LumasharpTF,thestring);
-
- XmScaleSetValue(LumafgopScale,vals[3]);
- itoa(vals[3], thestring);
- XmTextFieldSetString(LumafgopTF,thestring);
-
- /* set lock TB modes to off */
- XmToggleButtonSetState(YrangelockTB, False, True);
- }
-
- void dochroma(op)
- int op;
- {
- VLControlValue vlctlval;
- VLControlValue vlgotval;
-
- int gotvals[5];
- int range, value;
-
- /* getAllChromaScaleValues(&gotvals); */
-
- vlctlval.intVal = VL_EV1_KEYERMODE_CHROMA;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_KEYER_MODE, &vlctlval);
-
- if ((op == DO_U) || (op == DO_ALL))
- {
- XmScaleGetValue(UminScale,&gotvals[0]);
- XmScaleGetValue(UmaxScale,&gotvals[1]);
-
- minmaxtorangeval(gotvals[0], gotvals[1], &range, &value);
- vlctlval.intVal = range;
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_RANGE_CHROMA_U, &vlctlval);
- vlctlval.intVal = value;
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_VALUE_CHROMA_U,&vlctlval);
- }
- if ((op == DO_V) || (op == DO_ALL))
- {
- XmScaleGetValue(VminScale,&gotvals[2]);
- XmScaleGetValue(VmaxScale,&gotvals[3]);
-
- minmaxtorangeval(gotvals[2], gotvals[3], &range, &value);
- vlctlval.intVal = range;
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_RANGE_CHROMA_V, &vlctlval);
- vlctlval.intVal = value;
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_VALUE_CHROMA_V, &vlctlval);
- }
- /* always set detail; other operations can set this VL value, e.g. wipes */
- XmScaleGetValue(ChromasharpScale,&gotvals[4]);
- vlctlval.intVal = gotvals[4];
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_DETAIL, &vlctlval);
- }
-
- void doluma(op)
- int op;
- {
- VLControlValue vlctlval;
- VLControlValue vlgotval;
-
- int gotvals[4];
- int range, value;
-
- /* getAllLumaScaleValues(&gotvals); */
-
- vlctlval.intVal = VL_EV1_KEYERMODE_LUMA;
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_MODE, &vlctlval);
- if ((op == DO_Y) || (op == DO_ALL))
- {
- XmScaleGetValue(YminScale,&gotvals[0]);
- XmScaleGetValue(YmaxScale,&gotvals[1]);
- minmaxtorangeval(gotvals[0], gotvals[1], &range, &value);
- vlctlval.intVal = range;
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_RANGE_LUMA, &vlctlval);
- vlctlval.intVal = value;
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_VALUE_LUMA, &vlctlval);
- }
-
- /* always set detail; other operations can set these VL value, e.g. wipes */
- XmScaleGetValue(LumasharpScale,&gotvals[2]);
- vlctlval.intVal = gotvals[2];
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_DETAIL, &vlctlval);
- XmScaleGetValue(LumafgopScale,&gotvals[3]);
- vlctlval.intVal = gotvals[3];
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_FG_OPACITY, &vlctlval);
- }
-
- void
- uminScaleHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
- VLControlValue vlctlvalue;
- int minsetval;
- int maxsetval;
- int mingotval;
- int maxgotval;
- char thestring[5];
-
- minsetval = cs->value;
- if (Urangelock){
- /* if umax hits upper bound, restrict umin */
- if ((cs->value + Urangelockval) > UMAX_VAL){
- minsetval = UMAX_VAL - Urangelockval;
- XmScaleSetValue(UminScale, minsetval);
- }
- maxsetval = minsetval + Urangelockval;
- XmScaleSetValue(UmaxScale, maxsetval);
- itoa(maxsetval, thestring);
- XmTextFieldSetString(UmaxTF,thestring);
- } else
- {
- /* min should not be > max */
- /* if min is going past max, push the max up */
- XmScaleGetValue(UmaxScale, &maxgotval);
- if (minsetval > maxgotval){
- XmScaleSetValue(UmaxScale, minsetval);
- itoa(minsetval, thestring);
- XmTextFieldSetString(UmaxTF,thestring);
- } else {
- /* empty */
- }
- } /* end if Urangelock */
-
- itoa(minsetval, thestring);
- XmTextFieldSetString(UminTF,thestring);
- dochroma(DO_U);
- }
-
- void
- chromaBBdestroyHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- Arg args[256];
- Cardinal argcnt;
- Boolean argok;
-
- Shell001 = CreatechromaShell(AppShell);
- ChromaBBoard = CreatechromaBBoard(Shell001);
-
- }
-
- void
- lumaBBdestroyHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- Arg args[256];
- Cardinal argcnt;
- Boolean argok;
-
- Shell002 = CreatelumaShell(AppShell);
- LumaBBoard = CreatelumaBBoard(Shell002);
-
- }
-
- void
- switchBBdestroyHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- Arg args[256];
- Cardinal argcnt;
- Boolean argok;
-
- Shell003 = CreateswitchShell(AppShell);
- SwitchBBoard = CreateswitchBBoard(Shell003);
- }
-
- void
- umaxScaleHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
- VLControlValue vlctlvalue;
- int minsetval;
- int maxsetval;
- int mingotval;
- int maxgotval;
- char thestring[5];
-
- maxsetval = cs->value;
- if (Urangelock){
- /* if umin hits lower bound, restrict umax */
- if ((cs->value - Urangelockval) < UMIN_VAL){
- maxsetval = UMIN_VAL + Urangelockval;
- XmScaleSetValue(UmaxScale, maxsetval);
- }
- minsetval = maxsetval - Urangelockval;
- XmScaleSetValue(UminScale, minsetval);
- itoa(minsetval, thestring);
- XmTextFieldSetString(UminTF,thestring);
- } else
- {
- /* max should not be < min */
- /* if max is going below min, push the min down */
- XmScaleGetValue(UminScale, &mingotval);
- if (maxsetval < mingotval){
- XmScaleSetValue(UminScale, maxsetval);
- itoa(maxsetval, thestring);
- XmTextFieldSetString(UminTF,thestring);
- } else {
- /* empty */
- }
- } /* end if Urangelock */
- itoa(maxsetval, thestring);
- XmTextFieldSetString(UmaxTF,thestring);
- dochroma(DO_U);
- }
-
- void
- vminScaleHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
- VLControlValue vlctlvalue;
- int minsetval;
- int maxsetval;
- int mingotval;
- int maxgotval;
- char thestring[5];
-
- minsetval = cs->value;
- if (Vrangelock){
- /* if vmax hits upper bound, restrict vmin */
- if ((cs->value + Vrangelockval) > VMAX_VAL){
- minsetval = VMAX_VAL - Vrangelockval;
- XmScaleSetValue(VminScale, minsetval);
- }
- maxsetval = minsetval + Vrangelockval;
- XmScaleSetValue(VmaxScale, maxsetval);
- itoa(maxsetval, thestring);
- XmTextFieldSetString(VmaxTF,thestring);
- } else
- {
- /* min should not be > max */
- /* if min is going past max, push the max up */
- XmScaleGetValue(VmaxScale, &maxgotval);
- if (minsetval > maxgotval){
- XmScaleSetValue(VmaxScale, minsetval);
- itoa(minsetval, thestring);
- XmTextFieldSetString(VmaxTF,thestring);
- } else {
- /* empty */
- }
- } /* end if Vrangelock */
-
- itoa(minsetval, thestring);
- XmTextFieldSetString(VminTF,thestring);
- dochroma(DO_V);
- }
-
- void
- vmaxScaleHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
- VLControlValue vlctlvalue;
- int minsetval;
- int maxsetval;
- int mingotval;
- int maxgotval;
- char thestring[5];
-
- maxsetval = cs->value;
- if (Vrangelock){
- /* if vmin hits lower bound, restrict vmax */
- if ((cs->value - Vrangelockval) < VMIN_VAL){
- maxsetval = VMIN_VAL + Vrangelockval;
- XmScaleSetValue(VmaxScale, maxsetval);
- }
- minsetval = maxsetval - Vrangelockval;
- XmScaleSetValue(VminScale, minsetval);
- itoa(minsetval, thestring);
- XmTextFieldSetString(VminTF,thestring);
- } else
- {
- /* max should not be < min */
- /* if max is going below min, push the min down */
- XmScaleGetValue(VminScale, &mingotval);
- if (maxsetval < mingotval){
- XmScaleSetValue(VminScale, maxsetval);
- itoa(maxsetval, thestring);
- XmTextFieldSetString(VminTF,thestring);
- } else {
- /* empty */
- }
- } /* end if Vrangelock */
-
-
- itoa(maxsetval, thestring);
- XmTextFieldSetString(VmaxTF,thestring);
- dochroma(DO_V);
- }
-
-
- void
- urangelockTBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmToggleButtonCallbackStruct *cs=(XmToggleButtonCallbackStruct*)call;
- int mingotval;
- int maxgotval;
-
- if (cs->set){
- Urangelock = True;
- XmScaleGetValue(UmaxScale,&maxgotval);
- XmScaleGetValue(UminScale,&mingotval);
- Urangelockval = (maxgotval-mingotval);
- }
- else{
- Urangelock = False;
- }
- }
- void
- vrangelockTBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmToggleButtonCallbackStruct *cs=(XmToggleButtonCallbackStruct*)call;
- int mingotval;
- int maxgotval;
-
- if (cs->set){
- Vrangelock = True;
- XmScaleGetValue(VmaxScale,&maxgotval);
- XmScaleGetValue(VminScale,&mingotval);
- Vrangelockval = (maxgotval-mingotval);
- }
- else{
- Vrangelock = False;
- }
- }
- void
- yrangelockTBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmToggleButtonCallbackStruct *cs=(XmToggleButtonCallbackStruct*)call;
- int mingotval;
- int maxgotval;
-
- if (cs->set){
- Yrangelock = True;
- XmScaleGetValue(YmaxScale,&maxgotval);
- XmScaleGetValue(YminScale,&mingotval);
- Yrangelockval = (maxgotval-mingotval);
- }
- else{
- Yrangelock = False;
- }
- }
-
-
- void
- chromasharpScaleHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
- VLControlValue vlctlvalue;
- char thestring[5];
-
- itoa(cs->value, thestring);
- XmTextFieldSetString(ChromasharpTF,thestring);
- dochroma(DO_DETAIL);
- }
-
- void
- chromaDoPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmPushButtonCallbackStruct *acs=(XmPushButtonCallbackStruct*)call;
- dochroma(DO_ALL);
- }
-
- void
- chromaAPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
- if (XmToggleButtonGetState(ChromasetTB)){
- /* we want to get scale values into the preset memory */
- getAllChromaScaleValues(&ChromaPreA);
- /* undo set state:*/
- XmToggleButtonSetState(ChromasetTB, False, True);
- }
- else{
- /* we want to set scale values according to the preset memory */
- setAllChromaScaleValues(ChromaPreA);
- /* set the VL controls */
- dochroma(DO_ALL);
- }
- }
-
- void
- chromaBPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
- if (XmToggleButtonGetState(ChromasetTB)){
- /* we want to get scale values into the preset memory */
- getAllChromaScaleValues(&ChromaPreB);
- /* undo set state:*/
- XmToggleButtonSetState(ChromasetTB, False, True);
- }
- else{
- /* we want to set scale values according to the preset memory */
- setAllChromaScaleValues(ChromaPreB);
- /* set the VL controls */
- dochroma(DO_ALL);
- }
- }
-
- void
- chroma1PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
- if (XmToggleButtonGetState(ChromasetTB)){
- /* we want to get scale values into the preset memory */
- getAllChromaScaleValues(&ChromaPre1);
- /* undo set state:*/
- XmToggleButtonSetState(ChromasetTB, False, True);
- }
- else{
- /* we want to set scale values according to the preset memory */
- setAllChromaScaleValues(ChromaPre1);
- /* set the VL controls */
- dochroma(DO_ALL);
- }
- }
-
- void
- chroma2PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
- if (XmToggleButtonGetState(ChromasetTB)){
- /* we want to get scale values into the preset memory */
- getAllChromaScaleValues(&ChromaPre2);
- /* undo set state:*/
- XmToggleButtonSetState(ChromasetTB, False, True);
- }
- else{
- /* we want to set scale values according to the preset memory */
- setAllChromaScaleValues(ChromaPre2);
- /* set the VL controls */
- dochroma(DO_ALL);
- }
- }
-
- void
- chroma3PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
- if (XmToggleButtonGetState(ChromasetTB)){
- /* we want to get scale values into the preset memory */
- getAllChromaScaleValues(&ChromaPre3);
- /* undo set state:*/
- XmToggleButtonSetState(ChromasetTB, False, True);
- }
- else{
- /* we want to set scale values according to the preset memory */
- setAllChromaScaleValues(ChromaPre3);
- /* set the VL controls */
- dochroma(DO_ALL);
- }
- }
-
- void
- chroma4PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
- if (XmToggleButtonGetState(ChromasetTB)){
- /* we want to get scale values into the preset memory */
- getAllChromaScaleValues(&ChromaPre4);
- /* undo set state:*/
- XmToggleButtonSetState(ChromasetTB, False, True);
- }
- else{
- /* we want to set scale values according to the preset memory */
- setAllChromaScaleValues(ChromaPre4);
- /* set the VL controls */
- dochroma(DO_ALL);
- }
- }
-
- void
- chromasetTBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- }
-
- void
- yminScaleHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
- VLControlValue vlctlvalue;
- int minsetval;
- int maxsetval;
- int mingotval;
- int maxgotval;
- char thestring[5];
-
- minsetval = cs->value;
- if (Yrangelock){
- /* if ymax hits upper bound, restrict ymin */
- if ((cs->value + Yrangelockval) > YMAX_VAL){
- minsetval = YMAX_VAL - Yrangelockval;
- XmScaleSetValue(YminScale, minsetval);
- }
- maxsetval = minsetval + Yrangelockval;
- XmScaleSetValue(YmaxScale, maxsetval);
- itoa(maxsetval, thestring);
- XmTextFieldSetString(YmaxTF,thestring);
- } else
- {
- /* min should not be > max */
- /* if min is going past max, push the max up */
- XmScaleGetValue(YmaxScale, &maxgotval);
- if (minsetval > maxgotval){
- XmScaleSetValue(YmaxScale, minsetval);
- itoa(minsetval, thestring);
- XmTextFieldSetString(YmaxTF,thestring);
- } else {
- /* empty */
- }
- } /* end if Vrangelock */
-
- itoa(minsetval, thestring);
- XmTextFieldSetString(YminTF,thestring);
- doluma(DO_Y);
- }
-
- void
- ymaxScaleHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
- VLControlValue vlctlvalue;
- int minsetval;
- int maxsetval;
- int mingotval;
- int maxgotval;
- char thestring[5];
-
- maxsetval = cs->value;
- if (Yrangelock){
- /* if ymin hits lower bound, restrict ymax */
- if ((cs->value - Yrangelockval) < YMIN_VAL){
- maxsetval = YMIN_VAL + Yrangelockval;
- XmScaleSetValue(YmaxScale, maxsetval);
- }
- minsetval = maxsetval - Yrangelockval;
- XmScaleSetValue(YminScale, minsetval);
- itoa(minsetval, thestring);
- XmTextFieldSetString(YminTF,thestring);
- } else
- {
- /* max should not be < min */
- /* if max is going below min, push the min down */
- XmScaleGetValue(YminScale, &mingotval);
- if (maxsetval < mingotval){
- XmScaleSetValue(YminScale, maxsetval);
- itoa(maxsetval, thestring);
- XmTextFieldSetString(YminTF,thestring);
- } else {
- /* empty */
- }
- } /* end if Vrangelock */
-
-
- itoa(maxsetval, thestring);
- XmTextFieldSetString(YmaxTF,thestring);
- doluma(DO_Y);
- }
-
- void
- lumasharpScaleHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
- VLControlValue vlctlvalue;
- char thestring[5];
-
- itoa(cs->value, thestring);
- XmTextFieldSetString(LumasharpTF,thestring);
- doluma(DO_DETAIL);
- }
-
- void
- lumafgopScaleHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
- VLControlValue vlctlvalue;
- char thestring[5];
-
- itoa(cs->value, thestring);
- XmTextFieldSetString(LumafgopTF,thestring);
- doluma(DO_FGOP);
- }
-
- void
- lumaDoHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- doluma(DO_ALL);
- }
-
- void
- lumaAPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
- if (XmToggleButtonGetState(LumasetTB)){
- /* we want to get scale values into the preset memory */
- getAllLumaScaleValues(&LumaPreA);
- /* undo set state:*/
- XmToggleButtonSetState(LumasetTB, False, True);
- }
- else{
- /* we want to set scale values according to the preset memory */
- setAllLumaScaleValues(LumaPreA);
- /* set the VL controls */
- doluma(DO_ALL);
- }
- }
-
- void
- lumaBPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
- if (XmToggleButtonGetState(LumasetTB)){
- /* we want to get scale values into the preset memory */
- getAllLumaScaleValues(&LumaPreB);
- /* undo set state:*/
- XmToggleButtonSetState(LumasetTB, False, True);
- }
- else{
- /* we want to set scale values according to the preset memory */
- setAllLumaScaleValues(LumaPreB);
- /* set the VL controls */
- doluma(DO_ALL);
- }
- }
-
- void
- luma1PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
- if (XmToggleButtonGetState(LumasetTB)){
- /* we want to get scale values into the preset memory */
- getAllLumaScaleValues(&LumaPre1);
- /* undo set state:*/
- XmToggleButtonSetState(LumasetTB, False, True);
- }
- else{
- /* we want to set scale values according to the preset memory */
- setAllLumaScaleValues(LumaPre1);
- /* set the VL controls */
- doluma(DO_ALL);
- }
- }
-
- void
- luma2PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
- if (XmToggleButtonGetState(LumasetTB)){
- /* we want to get scale values into the preset memory */
- getAllLumaScaleValues(&LumaPre2);
- /* undo set state:*/
- XmToggleButtonSetState(LumasetTB, False, True);
- }
- else{
- /* we want to set scale values according to the preset memory */
- setAllLumaScaleValues(LumaPre2);
- /* set the VL controls */
- doluma(DO_ALL);
- }
- }
-
- void
- luma3PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
- if (XmToggleButtonGetState(LumasetTB)){
- /* we want to get scale values into the preset memory */
- getAllLumaScaleValues(&LumaPre3);
- /* undo set state:*/
- XmToggleButtonSetState(LumasetTB, False, True);
- }
- else{
- /* we want to set scale values according to the preset memory */
- setAllLumaScaleValues(LumaPre3);
- /* set the VL controls */
- doluma(DO_ALL);
- }
- }
-
- void
- luma4PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
- if (XmToggleButtonGetState(LumasetTB)){
- /* we want to get scale values into the preset memory */
- getAllLumaScaleValues(&LumaPre4);
- /* undo set state:*/
- XmToggleButtonSetState(LumasetTB, False, True);
- }
- else{
- /* we want to set scale values according to the preset memory */
- setAllLumaScaleValues(LumaPre4);
- /* set the VL controls */
- doluma(DO_ALL);
- }
- }
-
- void
- lumasetTBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- }
-
-
- void
- /* put everything into all bg or all fg (up to the caller) using luma */
- prepswitch(allbackground)
- int allbackground;
- {
- VLControlValue vlctlval;
- VLControlValue vlgotval;
- int lumavals[4];
- int allval;
-
- lumavals[0] = lumavals[1] = 0;
- if (allbackground == 1) /* want all bg */
- {
- lumavals[2] = -8; lumavals[3] = 0;
- }
- else /* want all fg */
- {
- lumavals[2] = 7; lumavals[3] = 255;
- }
- setAllLumaVLValues(lumavals);
- vlctlval.intVal = VL_EV1_KEYERMODE_LUMA;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_KEYER_MODE, &vlctlval);
- }
-
- void
- doswitchloop(min,max,speed,axis,endstate)
- int min;
- int max;
- int speed;
- int axis;
- {
- VLControlValue vlctlval;
- int i;
-
- vlctlval.fractVal.denominator = 1000;
- vlctlval.intVal = VL_EV1_KEYERMODE_SPATIAL;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_KEYER_MODE, &vlctlval);
- for (i = min; i <= max; i+= speed)
- {
- vlctlval.fractVal.numerator = i;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_POSN,&vlctlval);
- if (axis == 2 )
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_POSN_PERP,&vlctlval);
- }
- /* make sure wipe completes to clean end point: */
-
- vlctlval.intVal = 7;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
- if (endstate == 0)
- prepswitch(1);
- else
- prepswitch(2);
- }
-
- void
- doswitchloop2(min,max,speed,axis,endstate)
- int min;
- int max;
- int speed;
- int axis;
- {
- VLControlValue vlctlval;
- int i;
-
- vlctlval.fractVal.denominator = 1000;
- vlctlval.intVal = VL_EV1_KEYERMODE_SPATIAL;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_KEYER_MODE, &vlctlval);
- for (i = max; i >= min; i-= speed)
- {
- vlctlval.fractVal.numerator = i;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_POSN,&vlctlval);
- if (axis == 2 )
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_POSN_PERP,&vlctlval);
- }
- /* make sure wipe completes to clean end point: */
-
- vlctlval.intVal = 7;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
- if (endstate == 0)
- prepswitch(1);
- else
- prepswitch(2);
- }
-
- void
- doleftrightswitch()
- {
- VLControlValue vlctlval;
- VLControlValue vlgotval;
- int i, max, speed, switchpos;
-
- SwitchType = 1;
- vlctlval.fractVal.denominator = 1000;
-
- vlctlval.intVal = 1;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
-
- vlctlval.intVal = VL_EV1_WIPETYPE_SINGLE;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
- vlctlval.intVal = VL_EV1_WIPEANGLE_SE;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
- vlctlval.fractVal.numerator = 0;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
- vlctlval.intVal = 0;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
- vlctlval.intVal = -8+(15*fuzzfactor/100);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
- if (Automanualswitch)
- {
- max = 1000;
- /* note: 3 or 4 good default value */
- speed = 1+(int)(5*speedfactor/100);
- doswitchloop(0,max,speed,1,1); /* min,max,speed,axis,endstate */
- }else
- {
- XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
- vlctlval.fractVal.numerator = 10*switchpos; /* do wipe at posn */
- vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
- }
- }
-
- void
- leftrightswitchPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
- doleftrightswitch();
- }
-
-
- doelevatorhorizswitch()
- {
- VLControlValue vlctlval;
- int i, min, max, speed, switchpos;
-
- SwitchType = 2;
- vlctlval.fractVal.denominator = 1000;
-
- vlctlval.intVal = 1;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
-
- vlctlval.intVal = VL_EV1_WIPETYPE_SINGLE;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
- vlctlval.intVal = VL_EV1_WIPEANGLE_N;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
- vlctlval.fractVal.numerator = 500;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
- vlctlval.intVal = 0;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
- vlctlval.intVal = -8+(15*fuzzfactor/100);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
- if (Automanualswitch)
- {
- min = 400;
- max = 1000;
- speed = 1+(int)(5*speedfactor/100);
- doswitchloop(min,max,speed,1,1); /* min,max,speed,axis */
- }else
- {
- XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
- vlctlval.fractVal.numerator = 10*switchpos; /* do wipe at posn */
- vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
- }
-
- }
-
- void
- elevatorhorizswitchPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
- doelevatorhorizswitch();
- }
-
- docrossswitch()
- {
- VLControlValue vlctlval;
- int i, min, max, speed, switchpos;
-
- SwitchType = 3;
- vlctlval.fractVal.denominator = 1000;
-
- vlctlval.intVal = 1;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
-
- vlctlval.intVal = VL_EV1_WIPETYPE_CORNER;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
- vlctlval.intVal = VL_EV1_WIPEANGLE_SE;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
- vlctlval.fractVal.numerator = 500;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
- vlctlval.intVal = 0;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
- vlctlval.intVal = -8+(15*fuzzfactor/100);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
- if (Automanualswitch)
- {
- min = 400;
- max = 1000;
- speed = 1+(int)(8*speedfactor/100);
- doswitchloop(min,max,speed,2,1); /* min,max,speed,axis,endstate */
- }else
- {
- XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
- vlctlval.fractVal.numerator = 10*switchpos; /* do wipe at posn */
- vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
- }
-
- }
- void
- crossswitchPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
- docrossswitch();
- }
-
- dorectoutswitch()
- {
- VLControlValue vlctlval;
- int i, min, max, speed, switchpos;
-
- SwitchType = 4;
- vlctlval.fractVal.denominator = 1000;
-
- vlctlval.intVal = VL_EV1_WIPETYPE_CORNER;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
- vlctlval.intVal = VL_EV1_WIPEANGLE_NE;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
- vlctlval.fractVal.numerator = 500;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
- vlctlval.intVal = 0;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
- vlctlval.intVal = 1;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
- vlctlval.intVal = -8+(15*fuzzfactor/100);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
- if (Automanualswitch)
- {
- min = 0;
- max = 500;
- speed = 1+(int)(5*speedfactor/100);
- doswitchloop(min,max,speed,2,0); /* min,max,speed,axis,endstate */
- }else
- {
- XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
- vlctlval.fractVal.numerator = 10*switchpos; /* do wipe at posn */
- vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
- }
-
- }
- void
- rectoutswitchPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
- dorectoutswitch();
- }
-
- void
- doupperleftswitch()
- {
- VLControlValue vlctlval;
- int i,min, max, speed, switchpos;
-
- SwitchType = 5;
- vlctlval.fractVal.denominator = 1000;
-
- vlctlval.intVal = VL_EV1_WIPETYPE_CORNER;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
- vlctlval.intVal = VL_EV1_WIPEANGLE_SE;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
- vlctlval.fractVal.numerator = 0;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
- vlctlval.intVal = 0;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
- vlctlval.intVal = -8+(15*fuzzfactor/100);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
- if (Automanualswitch)
- {
- max = 1000;
- speed = 1+(int)(8*speedfactor/100);
- doswitchloop(0,max,speed,1,0); /* min,max,speed,axis,endstate */
- }else
- {
- XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
- vlctlval.fractVal.numerator = 10*switchpos; /* do wipe at posn */
- vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
- }
-
- }
-
- void
- upperleftswitchPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
- doupperleftswitch();
- }
-
- dosquaresswitch()
- {
- VLControlValue vlctlval;
- int i,min, max, speed, switchpos;
-
- SwitchType = 6;
- vlctlval.fractVal.denominator = 1000;
-
- vlctlval.intVal = VL_EV1_WIPETYPE_DOUBLE;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
- vlctlval.intVal = VL_EV1_WIPEANGLE_NE;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
- vlctlval.fractVal.numerator = 0;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
- vlctlval.intVal = 1+(4*repeatfactor/100);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
- vlctlval.intVal = 1;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
- vlctlval.intVal = 0;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
- vlctlval.intVal = -8+(15*fuzzfactor/100);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
- if (Automanualswitch)
- {
- max = 1000;
- speed = 1+(int)(9*speedfactor/100);
- doswitchloop(0,max,speed,2,0);
- }else
- {
- XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
- vlctlval.fractVal.numerator = 10*switchpos; /* do wipe at posn */
- vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
- vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN_PERP,&vlctlval);
- }
- }
-
- void
- squaresswitchPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
- dosquaresswitch();
- }
-
- dotilesswitch()
- {
- VLControlValue vlctlval;
- int i,min, max, speed, switchpos;
-
- SwitchType = 7;
- vlctlval.fractVal.denominator = 1000;
-
- vlctlval.intVal = 1;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
-
- vlctlval.intVal = VL_EV1_WIPETYPE_TILE;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
- vlctlval.intVal = VL_EV1_WIPEANGLE_NE;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
- vlctlval.fractVal.numerator = 0;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
- vlctlval.intVal = 1+(4*repeatfactor/100);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
- vlctlval.intVal = -8+(15*fuzzfactor/100);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
- if (Automanualswitch)
- {
- max = 1000;
- speed = 1+(int)(9*speedfactor/100);
- doswitchloop2(0,max,speed,2,0);
- }else
- {
- XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
- vlctlval.fractVal.numerator = (1000-10*switchpos); /* do wipe */
- vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
- vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN_PERP,&vlctlval);
- }
- }
-
- void
- tilesswitchPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
- dotilesswitch();
- }
-
- dofadeswitch()
- {
- VLControlValue vlctlval;
- int i,min, max, speed, switchpos;
-
- SwitchType = 8;
- vlctlval.fractVal.denominator = 1000;
-
- vlctlval.intVal = 1;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_SYMMETRY, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_INVERT, &vlctlval);
-
- vlctlval.intVal = VL_EV1_WIPETYPE_FADE;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_TYPE, &vlctlval);
- vlctlval.intVal = VL_EV1_WIPEANGLE_NE;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_ANGLE, &vlctlval);
- vlctlval.fractVal.numerator = 0;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_CENT_PERP, &vlctlval);
- vlctlval.intVal = 3;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT, &vlctlval);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_REPT_PERP, &vlctlval);
- vlctlval.intVal = -8+(15*fuzzfactor/100);
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_WIPE_FUZZ, &vlctlval);
- if (Automanualswitch)
- {
- max = 1000;
- speed = 1+(int)(10*speedfactor/100);
- doswitchloop2(0,max,speed,2,0);
- }else
- {
- XmScaleGetValue(ManualScale, &switchpos); /* get scale position */
- vlctlval.fractVal.numerator = 10*switchpos; /* do wipe at posn */
- vlSetControl(vlSvr,vlPath,blend_node,VL_EV1_WIPE_POSN,&vlctlval);
- }
- }
-
- void
- fadeswitchPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmPushButtonCallbackStruct *cs=(XmPushButtonCallbackStruct*)call;
- dofadeswitch();
- }
-
- void
- automanualTBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmToggleButtonCallbackStruct *cs=(XmToggleButtonCallbackStruct*)call;
-
- if (cs->set)
- {
- Automanualswitch = True;
- }
- else
- {
- Automanualswitch = False;
- }
- }
-
- void
- switchspeedScaleHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
- speedfactor = cs->value;
- }
-
- void
- fuzzScaleHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
- fuzzfactor = cs->value;
- }
-
- void
- manualScaleHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
- VLControlValue vlctlval;
-
- vlctlval.intVal = VL_EV1_KEYERMODE_SPATIAL;
- vlSetControl(vlSvr, vlPath, blend_node, VL_EV1_KEYER_MODE, &vlctlval);
- if (!Automanualswitch)
- {
- switch (SwitchType)
- {
- case 1:
- doleftrightswitch();
- break;
- case 2:
- doelevatorhorizswitch();
- break;
- case 3:
- docrossswitch();
- break;
- case 4:
- dorectoutswitch();
- break;
- case 5:
- doupperleftswitch();
- break;
- case 6:
- dosquaresswitch();
- break;
- case 7:
- dotilesswitch();
- break;
- case 8:
- dofadeswitch();
- break;
- }
- }
- }
-
- void
- repeatScaleHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmScaleCallbackStruct *cs=(XmScaleCallbackStruct*)call;
- repeatfactor = cs->value;
- }
-
- void
- util1PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- system("./util1.sh\n");
- }
-
- void
- util2PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- system("./util2.sh\n");
- }
-
- void
- helpPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- system("./help.sh\n");
- }
-
- void
- quitPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- if (Version_number < 2.0){
- system("killall mychroma\n");
- system("killall myswitch\n");
- }
- docleanup();
- }
-
- void
- option1PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- /* this option button used to redisplay widgets */
- if (Version_number < 2.0) {
- system("mychroma &\n");
- system("myswitch &\n");
- }
- else{
- XtManageChild(ChromaBBoard);
- XtPopup(XtParent(ChromaBBoard), XtGrabNone);
- XtManageChild(LumaBBoard);
- XtPopup(XtParent(LumaBBoard), XtGrabNone);
- XtManageChild(SwitchBBoard);
- XtPopup(XtParent(SwitchBBoard), XtGrabNone);
- }
- }
-
- void
- app1PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- system("./app1.sh\n");
- }
-
- void
- app2PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- system("./app2.sh\n");
- }
-
- void
- app3PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- system("./app3.sh\n");
- }
-
- void
- app4PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- system("./app4.sh\n");
- }
-
- void
- app5PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- system("./app5.sh\n");
- }
-
- void
- app6PBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- system("./app6.sh\n");
- }
-
- void
- grabnsavePBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- char cmd[50];
-
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- sprintf(cmd, "./grabnsave.sh %d", ev1num);
- system(cmd);
- }
-
- void
- grabndispPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- char cmd[50];
-
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- sprintf(cmd, "./grabndisp.sh %d", ev1num);
- system(cmd);
- }
-
- void
- vidovergfxPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *acs=(XmAnyCallbackStruct*)call;
- VLControlValue vlctlvalue;
- VLControlValue gotvalue;
-
- #ifdef DEBUG
- printf("vid/gfx callback\n");
- #endif
- vlctlvalue.intVal = src_vid;
- #ifdef DEBUG
- printf("src_vid value %d\n", vlctlvalue.intVal);
- #endif
- if (vlSetControl(vlSvr, vlPath, blend_node,
- VL_BLEND_A, &vlctlvalue)<0)
- {
- vlPerror("Setting blend A ");
- exit(1);
- }
- vlGetControl(vlSvr, vlPath, blend_node,
- VL_BLEND_A, &gotvalue);
- #ifdef DEBUG
- printf("blend a (fg) set to %d\n", gotvalue.intVal);
- #endif
- vlctlvalue.intVal = src_scr;
- #ifdef DEBUG
- printf("src_scr value %d\n", vlctlvalue.intVal);
- #endif
- if (vlSetControl(vlSvr, vlPath, blend_node,
- VL_BLEND_B, &vlctlvalue)<0)
- {
- vlPerror("Setting blend B ");
- exit(1);
- }
- vlGetControl(vlSvr, vlPath, blend_node,
- VL_BLEND_B, &gotvalue);
- #ifdef DEBUG
- printf("blend a (bg) set to %d\n", gotvalue.intVal);
- #endif
- vlGetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_MODE, &gotvalue);
- if (gotvalue.intVal == VL_EV1_KEYERMODE_LUMA)
- doluma(DO_ALL);
- else
- if (gotvalue.intVal == VL_EV1_KEYERMODE_CHROMA)
- dochroma(DO_ALL);
- }
-
- void
- gfxovervidPBHandler(w, client, call)
- Widget w;
- XtPointer client;
- XtPointer call;
- {
- XmAnyCallbackStruct *cs=(XmAnyCallbackStruct*)call;
- VLControlValue vlctlvalue;
- VLControlValue gotvalue;
- VLControlValue val;
-
- vlctlvalue.intVal = src_scr;
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_BLEND_A, &vlctlvalue);
- vlctlvalue.intVal = src_vid;
- vlSetControl(vlSvr, vlPath, blend_node,
- VL_BLEND_B, &vlctlvalue);
- vlGetControl(vlSvr, vlPath, blend_node,
- VL_EV1_KEYER_MODE, &gotvalue);
- if (gotvalue.intVal == VL_EV1_KEYERMODE_LUMA)
- doluma(DO_ALL);
- else
- if (gotvalue.intVal == VL_EV1_KEYERMODE_CHROMA)
- dochroma(DO_ALL);
-
-
- }
-
-